package com.eshin.application;

import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class DemoListener2{
	
	    @Async
	    @EventListener //注意此处 此时不用implements ApplicationListener<DemoEvent>
	    public void handleDemoEvent(DemoEvent event){
	        System.out.println("DemoListener2：我监听到了pulisher发布的message为:"+event.getMsg()+""+
	    Thread.currentThread().getName());

	    }
}